import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.awt.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.File;

public class MainTestCase {

    private static Logger LOGGER = LoggerFactory.getLogger(MainTestCase.class);

    //@Test
    public void mainTest() throws IOException, DocumentException {

        LOGGER.info("测试开始");
        /*
        Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("C:\\Users\\surface\\test.pdf"));
        document.open();
        //BaseFont bfChinese = BaseFont.createFont("C:\\Users\\surface\\IdeaProjects\\net.wangds.pdfcomp\\src\\main\\resources\\SourceHanSerifCn-Light.ttf",BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
        BaseFont bfChinese = BaseFont.createFont("C:\\Users\\surface\\IdeaProjects\\net.wangds.pdfcomp\\src\\main\\resources\\SourceHanSansK-Light.ttf",BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
        //BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
        Font blueFont = new Font(bfChinese);
        blueFont.setColor(Color.BLUE);

        document.add(new Paragraph("你好",blueFont));
        document.close();
        writer.flush();
        */

    }

    @Test
    public void readTest(){


        try {
            PdfReader reader = new PdfReader(new FileInputStream("C:\\Users\\surface\\IdeaProjects\\template-spring-boot-v2\\module-common-pdf\\src\\test\\resources\\img.pdf"));


        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
